package com.idlefish.flutterboost.containers;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.idlefish.flutterboost.FlutterBoost;

import io.flutter.embedding.android.FlutterFragment;
import io.flutter.embedding.android.RenderMode;
import io.flutter.embedding.engine.FlutterEngine;

public class FlutterSingleFragment extends FlutterFragment {

    @NonNull
    @Override
    public RenderMode getRenderMode() {
        return RenderMode.texture;
    }


    @Nullable
    @Override
    public FlutterEngine provideFlutterEngine(@NonNull Context context) {
        if (FlutterBoost.instance().getEngine() != null) {
            return FlutterBoost.instance().getEngine();
        }
        return super.provideFlutterEngine(context);
    }

}
